package cn.com.hhrcw.utils;

import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;

/**
 * @program: recruit-boot-parent
 *
 * @author: JD
 * @create: 2020-12-19 10:27
 **/
public class CheckUtils {

    public static boolean isNull(Object item) {
        if (item == null) {
            return true;
        }
        Field[] fields = item.getClass().getDeclaredFields();
        for (Field field : fields) {
            field.setAccessible(true);
            try {
                Object value = field.get(item);
                if (value != null && StringUtils.isNotBlank(value.toString())) {
                    return false;
                }
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return true;
    }
}
